<?php  
echo '<?xml version="1.0" encoding="utf-8" ?> 
<Piecemaker>
  <Contents>';

  require("../../../../../wp-load.php");
	function select_slides() {
		global $wpdb;
		$display_slides_query = 'SELECT * FROM `'.$wpdb->prefix.'lazar_slider` WHERE `active` = 1 ORDER BY position';
		$display_slides = $wpdb->get_results($display_slides_query);
		return $display_slides;
		
	}
	
	$display_slides = select_slides();
	
	foreach ( $display_slides as $slide )
	{ 
		echo '<Image Source="';
			echo get_template_directory_uri();
			echo  '/includes/timthumb.php?src=';
			echo $slide->img;
			echo '&amp;h=385&amp;w=960&amp;zc=1&amp;q=100"';
			
			if ( $slide->title != 'no_title' )
			{
				echo ' Title="';
				echo $slide->title;
				echo '"';
			}
		echo '>';
			
			if ( $slide->title != 'no_title' || $slide->text != 'no_text' )
				echo '<Text>';
				
				if ( $slide->title != 'no_title' )
				{
					echo '<h1>';
						echo $slide->title;
					echo '</h1>';
				}
				
				if ( $slide->text != 'no_text' )
				{
					echo '<p>';
						echo $slide->text;
					echo '</p>';
				}
				
			if ( $slide->title != 'no_title' || $slide->text != 'no_text' )
				echo '</Text>';
			
			if ( $slide->link != 'no_link' )
				{
					echo '<Hyperlink URL="';
					echo $slide->link;
					echo '" Target="_blank" />';
				}
		echo '</Image>';
	}


   
	 
	

	
	echo '
	</Contents>
  <Settings ImageWidth="960" ImageHeight="385" LoaderColor="0x333333" InnerSideColor="0x222222" SideShadowAlpha="0.5" DropShadowAlpha="0.25" DropShadowDistance="25" DropShadowScale="0.95" DropShadowBlurX="40" DropShadowBlurY="4" MenuDistanceX="20" MenuDistanceY="20" MenuColor1="0x777777" MenuColor2="0x333333" MenuColor3="0xFFFFFF" ControlSize="50" ControlDistance="20" ControlColor1="0x222222" ControlColor2="0xFFFFFF" ControlAlpha="0.8" ControlAlphaOver="0.95" ControlsX="940" ControlsY="340&#xD;&#xA;" ControlsAlign="right" TooltipHeight="30" TooltipColor="0x111111" TooltipTextY="5" TooltipTextStyle="P-Italic" TooltipTextColor="0xFFFFFF" TooltipMarginLeft="5" TooltipMarginRight="7" TooltipTextSharpness="50" TooltipTextThickness="-100" InfoWidth="440" InfoBackground="0x000000" InfoBackgroundAlpha="0.80" InfoMargin="15" InfoSharpness="0" InfoThickness="0" Autoplay="10" FieldOfView="45"></Settings>
  <Transitions>
    <Transition Pieces="9" Time="1.2" Transition="easeInOutBack" Delay="0.1" DepthOffset="300" CubeDistance="30"></Transition>
    <Transition Pieces="15" Time="3" Transition="easeInOutElastic" Delay="0.03" DepthOffset="200" CubeDistance="10"></Transition>
    <Transition Pieces="5" Time="1.3" Transition="easeInOutCubic" Delay="0.1" DepthOffset="500" CubeDistance="50"></Transition>
    <Transition Pieces="9" Time="1.25" Transition="easeInOutBack" Delay="0.1" DepthOffset="900" CubeDistance="5"></Transition>
  </Transitions>
</Piecemaker>';
?>